import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/material.dart' hide Action; //注意要隐藏Actio类
import 'package:flutter/widgets.dart' hide Action;  //注意要隐藏Actio类
import 'view.dart';
import 'action.dart';
import 'state.dart';

Effect<PersonListState> buildEffect() {
  return combineEffects(<Object, Effect<PersonListState>>{
    Lifecycle.initState: _initController, //页面初始化监听tabbar控制
  });
}
void _initController(Action action,Context<PersonListState> ctx){
  final TickerProvider tickerProvider = ctx.stfState  as TickerProvider;
  var _controller =TabController(vsync: tickerProvider,length: tabList.length);
  _controller.addListener((){
    println(_controller.index);
  });
  ctx.dispatch(PersonListActionCreator.onChangeTabListAction({tabList:tabList,'controller':_controller}));
}
